home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 018a / zip2zi31.zip / ZIP2ZMOP.BAT < prev    next >
DOS Batch File  |  1993-05-31  |  3KB  |  81 lines

  1. @Echo off
  2. Rem  ZIP2ZMOP.BAT To Clean Up Files as Called By ZIP2ZIP?.BAT's
  3.  
  4. GoTo Start
  5. Rem       This is a POWERFUL DELETE Batch Flie. Change With CAUTION!
  6. Rem Env Variable SAFETY is SET in ZIP2ZIP.BAT. Protect from Cmd Line "testing"
  7. Rem %1 is Supplied by ZIP2ZIP?.BAT as "D:\SubDir\"  (The orig %1 from cmd line)
  8. Rem %2 is Supplied by ZIP2ZIP?.BAT as "Z_B or Z_B\Z_C" Start Search Path
  9. Rem %3 is Supplied by ZIP2ZIP?.BAT as "Z_B   Z_C Z_D"  Search Word
  10. Rem %4 Is Either Blank or Y, depending on if Ok or Canceled conversion.
  11. Rem        ╔═══════════  Supplied Parmeters By  ════════════╗
  12. Rem        ║   %%1   %%2 Start in; & to Rd    %%3 srch  %%4 ║
  13. Rem        V════════════════════════════════════════════════╝
  14. Rem ZIP2ZIPB   %%1   Z_B  (Place holder)   Z_B   %CNZL%
  15. Rem        C   %%1   Z_B                   Z_C   %CNZL%
  16. Rem        D   %%1   Z_B\Z_C               Z_D   %CNZL%
  17.                   \_ Has a Trailing "\"
  18. Rem The ONLY reason that this is run is to do Failed Zips or OK Zips that
  19. Rem have a read only File in which case PKZip can't Delete the work dir Z_?
  20.  
  21. :Start
  22.  
  23.    IF NOT "%1"=="" IF NOT "%2"=="" IF "%SAFETY%"=="0Ff" GoTo ZIP2_MOP_UP
  24.  
  25.         GoTo ZIP2_ONLY
  26.  
  27. :ZIP2_MOP_UP
  28. Rem Next Line VERY Important. Only Do Cancels once from _B, Not stepwise.
  29.     IF NOT "%3"=="Z_B" IF "%4"=="Y" GoTo End
  30.  
  31.     Echo Zip2zMOP.Bat Executing
  32.  
  33.     GoTo %3
  34.  
  35. :Z_B
  36.    Call ZIP2-SDE.BAT   %1 %3
  37.    Echo ...Exiting Zip2zMOP
  38.        IF "%FSIZE%"==""       GoTo Prog_Err
  39.         IF "%FSIZE%"=="0"     GoTo End
  40.           IF NOT "%4"==""     GoTo CNZL_YES
  41.  
  42.       Echo   !Above ZIP Contained a Read Only File (Perhaps Hidden, System) >>%1ZIP2ZIP.LOG
  43.       Echo   !Contained a Read Only HSR (Hidden, Sys or Read Only)
  44.  
  45. :CNZL_YES
  46.    Attrib %1%2\*.* -r -h -s /S
  47.    PKZIP  %1%2\JUNK   %1%2\*.*  -mrp -e0
  48.    For %%f in (%1%2\*.*)    DO Del %%f >Nul
  49.    Rd %1%2
  50.    GoTo End
  51.  
  52. :Z_C
  53. :Z_D
  54.    Call ZIP2-SDE.BAT   %1%2\ %3
  55.    Echo ...Exiting Zip2zMOP
  56.    IF "%FSIZE%"==""    GoTo Prog_Err
  57.    IF "%FSIZE%"=="0"   GoTo End
  58.  
  59.    Echo   !Above Contained a Read Only File (Perhaps Hidden, System)  >>%1ZIP2ZIP.LOG
  60.    Echo   !Contained a Read Only HSR (Hidden, Sys or Read Only)
  61.  
  62.    Attrib %1%2\%3\*.* -r -h -s /S
  63.    PKZIP  %1%2\%3\JUNK   %1%2\%3\*.*  -mrp -e0
  64.    For %%f in (%1%2\%3\*.*) DO Del %%f >Nul
  65.    Rd %1%2\%3
  66.    GoTo End
  67.  
  68. :ZIP2_ONLY
  69.  
  70.    Echo THIS %0 SHOULD ONLY BE RUN AS CALLED BY ZIP2ZIP?.BAT Files
  71.    GoTo End
  72.  
  73. :PROG_ERR
  74.  
  75.    Echo Major Flaw in Program Logic. Stop Using This Program. Contact Author.
  76.    Echo Major Flaw in Program Logic Encountered in Zip2zMOP.BAT >>%1ZIP2ZIP.LOG
  77.    Echo Cancel With ^C (Control C)
  78.    Pause
  79.  
  80. :End
  81.